package com.newtribe.access;
import java.io.DataInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Arrays;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.newtribe.access.context.PeerContext;


/**
 * 
 */

/**
 * @author newtribe
 *
 */
public class RdpProcessor extends Processor{
	


	  public RdpProcessor(Server parent, int seq) {
	    super(parent, seq);
	  }
	  /**
	   * logger instance .
	   */
	  public static Log log =LogFactory.getLog(RdpProcessor.class) ;
	  
	  /**
	   * server state information  instance
	   */
	 
	  /**
	   * init out runtime environment .
	   *
	   */
	  public void init() {

	  }
	  


	  /**
	   * when accept , process a socket .
	   * @param socket
	   * @throws java.lang.Exception
	   */
	  public void process(Socket socket ) throws Exception {
		  
		  // user login authentication
		  //recognize a request or response socket .
		  //

// 		
 		  PeerContextFactory factory =PeerContextFactory.getFactory();
 		  PeerContext peerContext = factory.getContext("fuwei");
 		  
 		
 		  peerContext.setRdpRequestSocket(socket);
 		
//
//		    Socket   rdpSocket=new Socket("192.168.11.130",3389);
//
// 	 		peerContext.setRdpResponseSocket(rdpSocket);
// 	 
 			peerContext.start();

	    
// 		if (peerContext.getStatus() ==3) {
// 			//client and server have been ready .
// 			//assign a new task to 
// 			//execute queue .
// 			peerContext.start();
// 		}
 
	    }




	  public static void main(String[] args) {
	  }

}